package com.example.net.retrofit;


import com.example.bean.Result;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * create by Test on 2024/4/11 Time：16:24
 * describe:
 */
public interface IApi {
    @GET("getmethod")
    Call<Result> get(@Query("username") String username);

    @POST("postmethod")
    @FormUrlEncoded
    Call<Result> post(@Field("username") String username);
    @POST("postmethod")
    @Multipart
    Call<Result> postMultipart(@Part("username")RequestBody username);
    @POST("postjson")
    Call<Result> postJson(@Body RequestBody jsonBody);
}
